package cn.bdqn.appinfo.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.bdqn.appinfo.util.Result;

/**
 * 处理默认的错误页面
 * @author Administrator
 *
 */
@Controller
public class ErrorController {
	@RequestMapping(value={"/error_500","/error_501","/error_502"})
	@ResponseBody
	public Result error_5xx(HttpServletRequest req, HttpServletResponse response) {
		return Result.error(req.getRequestURI());
	}
	@RequestMapping(value={"/error_400","/error_401","/error_403","/error_404","/error_405","/error_406"})
	@ResponseBody
	public Result error_4xx(HttpServletRequest req, HttpServletResponse response) {
		return Result.error(req.getRequestURI());
	}
}
